//
//  SyneminFirstPageTVC.m
//  ContactOf0825
//
//  Created by 韩震明 on 15/11/23.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "SyneminFirstPageTVC.h"
#import <Masonry.h>
// 这个常量,就可以在使用Masonry不必总带着前缀 `mas_`:
#define MAS_SHORTHAND

// 定义这个常量,以支持在 Masonry 语法中自动将基本类型转换为 object 类型:
#define MAS_SHORTHAND_GLOBALS

@implementation SyneminFirstPageTVC

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell
{
    self.nameLabel = [[UILabel alloc] init];
    self.nameLabel.layer.borderWidth = 1;
    self.nameLabel.layer.cornerRadius = 5;
    [self.contentView addSubview:self.nameLabel];
    
    self.sexLabel = [[UILabel alloc] init];
    self.sexLabel.layer.borderWidth = 1;
    self.sexLabel.layer.cornerRadius = 5;
    [self.contentView addSubview:self.sexLabel];
    
    self.numberLabel = [[UILabel alloc] init];
    self.numberLabel.layer.borderWidth = 1;
    self.numberLabel.layer.cornerRadius = 5;
    [self.contentView addSubview:self.numberLabel];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.contentView);
        make.right.equalTo(self.sexLabel.mas_left).with.offset(-10);
        make.bottom.equalTo(self.contentView);
    }];
    
    [self.sexLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.nameLabel.mas_right).with.offset(10);
        make.right.equalTo(self.numberLabel.mas_left).with.offset(-10);
        make.bottom.equalTo(self.contentView);
        make.width.equalTo(self.nameLabel);
        
    }];
    
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.sexLabel.mas_right).with.offset(10);
        make.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
        make.width.equalTo(self.nameLabel);
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
